package icu.yougan.trade.service.Impl;

import icu.yougan.trade.entity.User;
import icu.yougan.trade.service.AuthenticationService;
import icu.yougan.trade.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Service;

@Service
public class AuthenticationServiceImpl implements AuthenticationService
{
    @Resource
    private UserService userService;
    @Override
    public User getUserIdByAuthentication(Authentication authentication)
    {
        String accountNumber = authentication.getName();
        return userService.getUserByAccountNum(accountNumber);
    }
}
